/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.shelf.web.Shelf2Action
   Module Description   :

   Date Created      : 2009/11/30
   Original Author   : ellen.li
   Team              : yaodian100
   TODO:1.上下架的状态。2。必填欄位
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.shelf.web;

import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import javax.annotation.Resource;

import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.lang.xwork.StringUtils;
import org.apache.struts2.ServletActionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.yaodian100.core.admin.entity.Permission.Type;
import com.yaodian100.core.admin.entity.Role;
import com.yaodian100.core.admin.entity.User;
import com.yaodian100.core.admin.service.UserService;
import com.yaodian100.core.admin.utils.AdminHelper;
import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.entity.SimplePager;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.core.common.utils.DateUtil;
import com.yaodian100.core.menu.entity.Menu;
import com.yaodian100.ec.category.service.CategoryService;
import com.yaodian100.ec.common.EcConstant;
import com.yaodian100.ec.product.entity.Product;
import com.yaodian100.ec.product.entity.ProductTuangouOP;
import com.yaodian100.ec.product.service.ProductService;
import com.yaodian100.ec.quotation.service.QuotationService;
import com.yaodian100.ec.quotation.service.QuotationServiceOnline;
import com.yaodian100.ec.shelf.entity.Shelf;
import com.yaodian100.ec.shelf.entity.ShelfTuangou;
import com.yaodian100.ec.shelf.service.ShelfService;
import com.yaodian100.ec.shelf.service.ShelfTuangouService;
import com.yaodian100.ec.timelimitsale.service.TimeLimitSaleService;
import com.yaodian100.erp.quotation.remote.Quotation;

/**
 * @author ellen.li
 * 
 */
public class Shelf2Action extends ActionSupport implements Preparable {

	/**
	 * serial version
	 */
	private static final long serialVersionUID = -5872758578609930899L;
	private final Logger logger = LoggerFactory.getLogger(Shelf2Action.class);
	@Resource
	private ProductService productService;
	@Resource
	private UserService userService;
	@Resource
	private DomainService<Menu> menuService;
	@Resource
	private ShelfService shelfService;
	@Resource
	private CategoryService categoryService;
	CommonCriteria crit;
	private List<User> users;
	private String productName;
	private List<Shelf> shelfs;
	private Shelf shelf;
	private Shelf shelfNow;
	private SimplePager pager;
	private String productId;
	private String[] shelfDelete;
	private Long shelfId;
	private Product product;
	private String jsonShelfDateExist;
	private QuotationService quotationService;
	private QuotationServiceOnline quotationServiceOnline;
	private List<Map<String, String>> jsonDatas;
	private String minDate;
	private Menu shelfStatusMenu;
	private Menu shelfQueryStatusMenu;
	private Menu shelfTypeMenu;
	private String shelfStatus;
	private String approveFailReason;
	private String approve;
	private String loginUser;
	private String shelfType;
	private Map productMap;
	private List<Map<String, Object>> shelfHistoryList;
	/* 上下架商品頁面參數 */
	private String promoteNameParam;
	private String startDateParam;
	private String endDateParam;
	private String timestart;
	private String timeend;
	private String shelfPriceParam;
	private String shelfStatusParam;
	private String shelfMemoParam;

	/*
	 * 审核查询页面参数
	 */
	private String productIdParam;
	private String createUserParam;
	private String statusParam;
	private String createDateParam;
	private String productNameParam;

	// 雙屬性 start
	private String validateNumParam;
	private String limitBuyParam;
	private String nowStep = "4";

	// 毛利率
	private BigDecimal grossProfit;
	@Resource
	private TimeLimitSaleService timeLimitSaleService;

	// 雙屬性 end

	/* 團購 */
	@Resource
	private ShelfTuangouService shelfTuangouService;
	private Menu shelfTuangouStatusMenu;
	private Menu shelfTuangouQueryStatusMenu;
	private Menu shelfTuangouSortSeqMenu;
	private List<User> tuangouUsers;
	private String shelfTuangouQueryStatus;
	private SimplePager tuangouPager;
	private List<ShelfTuangou> tuangouShelfs;
	private ShelfTuangou tuangouShelfNow;
	private String shelfTuangouStatus;
	private String[] shelfTuangouDelete;
	private ShelfTuangou shelfTuangou;
	private Long tuangouId;
	private String approveTuangou;
	private List<Map<String, Object>> shelfTuangouHistoryList;
	private String memberLimit;
	private String shelfTuangouPrice;
	private String approveTuangouFailReason;
	private String tuangouPromoteName;
	private String tuangouStartDate;
	private String tuangouEndDate;
	private String tuangouStartTime;
	private String tuangouEndTime;
	private String shelfTuangouSortSeq;
	private String tuangouLowestOrderQty;
	private String shelfTuangouMemo;
	private Map mapJson;
	private String tuangouDesc;

	public String add() throws Exception {
		product = productService.get(productId);
		productName = product.getProductName();
		shelf = null;
		shelfId = null;
		// shelf.setShelfStatus("SHF000");
		approve = null;
		shelfType = "1";
		shelfHistoryList = shelfService.getShelfHistory(productId);
		validateNumParam = "N";
		limitBuyParam = "N";
		// startDateParam="";
		grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
		return "edit";
	}

	public String addTuangou() throws Exception {
		product = productService.get(productId);
		productName = product.getProductName();
		shelfTuangou = null;
		tuangouId = null;
		approveTuangou = null;
		shelfTuangouHistoryList = shelfTuangouService.getShelfTuangouHistory(productId);
		memberLimit = "Y";
		grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());

		return "editTuangou";
	}

	/**
	 * 停用上架檔
	 * 
	 * @return
	 * @throws Exception
	 */
	public String delShelf() throws Exception {
		if (null != shelfDelete) { // 停用该上架檔
			for (int i = 0; i < shelfDelete.length; i++) {
				shelf = shelfService.get(Long.parseLong(shelfDelete[i]));
				shelf.setShelfStatus("SHF700");// 下架
				shelfService.update(shelf);
				// shelfService.delete(shelf);
			}
			addActionMessage("异动笔数:" + shelfDelete.length);
		}
		return list();
	}

	public String delShelfTuangou() throws Exception {
		if (null != shelfTuangouDelete) { // 停用该团购活动上架檔
			for (int i = 0; i < shelfTuangouDelete.length; i++) {
				shelfTuangou = shelfTuangouService.get(Long.parseLong(shelfTuangouDelete[i]));
				shelfTuangou.setStatus("SHF700");// 下架
				shelfTuangouService.update(shelfTuangou);
			}
			addActionMessage("异动笔数:" + shelfTuangouDelete.length);
		}
		return list();
	}

	/* 編輯上下架商品 */
	public String edit() throws Exception {
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return "edit";
		}
		product = productService.get(productId);
		if (null == product) {
			addActionError("查无商品资料(或无该权限查看)");
			return "edit";
		} else {
			productName = product.getProductName();
			if (null != shelfId) {
				try {
					if (StringUtils.isNotBlank(String.valueOf(shelfId))) {
						shelf = shelfService.get(shelfId);
						timestart = FastDateFormat.getInstance("HH:mm").format(shelf.getStartDate());
						timeend = FastDateFormat.getInstance("HH:mm").format(shelf.getEndDate());
					}
					shelfHistoryList = shelfService.getShelfHistory(shelf.getProductId());
				} catch (CoreException e) {
					addActionError(e.getMessage());
					e.printStackTrace();
				}
			}
			grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
		}
		return "edit";
	}

	public String editTuangou() throws Exception {
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return "editTuangou";
		}
		product = productService.get(productId);
		if (null == product) {
			addActionError("查无商品资料(或无该权限查看)");
			return "editTuangou";
		} else {
			productName = product.getProductName();
			if (null != tuangouId) {
				try {
					if (StringUtils.isNotBlank(String.valueOf(tuangouId))) {
						shelfTuangou = shelfTuangouService.get(tuangouId);
						tuangouStartTime = FastDateFormat.getInstance("HH:mm").format(shelfTuangou.getStartDate());
						tuangouEndTime = FastDateFormat.getInstance("HH:mm").format(shelfTuangou.getEndDate());
					}
					shelfTuangouHistoryList = shelfTuangouService.getShelfTuangouHistory(shelfTuangou.getProductId());
				} catch (CoreException e) {
					addActionError(e.getMessage());
					e.printStackTrace();
				}
			}
			grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
		}
		return "editTuangou";
	}

	public String view() throws Exception {
		approve = null;
		if (null == shelfId) {
			addActionError("传入参数错误:shelfId=" + shelfId);
			return "list";
		} else {
			shelf = shelfService.get(shelfId);
			if (null == shelf) {
				addActionError("上架檔不存在:shelfId=" + shelfId);
				return "list";
			}
			product = productService.get(shelf.getProductId());
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return "list";
			}
			shelfHistoryList = shelfService.getShelfHistory(shelf.getProductId());
			grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
		}
		return "view";
	}

	public String tuangouView() throws Exception {
		approveTuangou = null;
		if (null == tuangouId) {
			addActionError("传入参数错误:tuangouId=" + tuangouId);
			return "list";
		} else {
			shelfTuangou = shelfTuangouService.get(tuangouId);
			if (null == shelfTuangou) {
				addActionError("上架檔不存在:tuangouId=" + tuangouId);
				return "list";
			}
			product = productService.get(shelfTuangou.getProductId());
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return "list";
			}
			shelfTuangouHistoryList = shelfTuangouService.getShelfTuangouHistory(shelfTuangou.getProductId());
			grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
		}
		return "tuangouView";
	}

	/**
	 * @return the endDateParam
	 */
	public String getEndDateParam() {
		return endDateParam;
	}

	/**
	 * 取得後台成本
	 * 
	 * @return
	 * @throws ParseException
	 * @throws CoreException
	 */
	public String getJsonCheckCost() throws ParseException, CoreException {
		Date start = DateUtil.convertStringToDate(EcConstant.PATTERN_TIMESTAMP_HH_MM,
				startDateParam + " " + timestart.trim());
		Date end = DateUtil.convertStringToDate(EcConstant.PATTERN_TIMESTAMP_HH_MM, endDateParam + " " + timeend.trim());
		start = DateUtil.getFirstTimestamp(Calendar.MINUTE, start);
		end = DateUtil.getLastTimestamp(Calendar.MINUTE, end);
		product = productService.get(productId);
		List<Quotation> quotations;
		if (ServletActionContext.getRequest().getServerName().equals("ecadmin.yaodian100.com")) {
			quotations = quotationServiceOnline.getTargetPeriodQuotations(productId, product.getSupplierId(), start, end);
		} else {
			quotations = quotationService.getTargetPeriodQuotations(productId, product.getSupplierId(), start, end);
		}

		if (quotations != null) {
			jsonDatas = new ArrayList<Map<String, String>>();
			for (int i = 0; i < quotations.size(); i++) {
				Quotation quotation = quotations.get(i);
				Map<String, String> map = new TreeMap<String, String>();
				map.put("effectiveDateString", quotation.getEffectiveDateString());
				map.put("unitPrice", quotation.getUnitPrice() + "");
				jsonDatas.add(map);
			}
		}

		return "jsonDatas";
	}

	/**
	 * 取得團購後台成本
	 * 
	 * @return
	 * @throws ParseException
	 * @throws CoreException
	 */
	public String getJsonCheckTuangouCost() throws ParseException, CoreException {
		Date start = DateUtil.convertStringToDate(EcConstant.PATTERN_TIMESTAMP_HH_MM, tuangouStartDate + " "
				+ tuangouStartTime.trim());
		Date end = DateUtil.convertStringToDate(EcConstant.PATTERN_TIMESTAMP_HH_MM,
				tuangouEndDate + " " + tuangouEndTime.trim());
		start = DateUtil.getFirstTimestamp(Calendar.MINUTE, start);
		end = DateUtil.getLastTimestamp(Calendar.MINUTE, end);

		product = productService.get(productId);
		List<Quotation> quotations;
		if (ServletActionContext.getRequest().getServerName().equals("ecadmin.yaodian100.com")) {
			quotations = quotationServiceOnline.getTargetPeriodQuotations(productId, product.getSupplierId(), start, end);
		} else {
			quotations = quotationService.getTargetPeriodQuotations(productId, product.getSupplierId(), start, end);
		}

		if (quotations != null) {
			jsonDatas = new ArrayList<Map<String, String>>();
			for (int i = 0; i < quotations.size(); i++) {
				Quotation quotation = quotations.get(i);
				Map<String, String> map = new TreeMap<String, String>();
				map.put("effectiveDateString", quotation.getEffectiveDateString());
				map.put("unitPrice", quotation.getUnitPrice() + "");
				jsonDatas.add(map);
			}
		}

		return "jsonDatas";
	}

	public String queryOrderOperator() throws ParseException, CoreException {
		ProductTuangouOP productTuangouOP = shelfTuangouService.queryOrderOperator(tuangouId.toString());
		mapJson = null;
		if (productTuangouOP != null) {
			mapJson = new TreeMap();
			mapJson.put("createUser", productTuangouOP.getCreateUser());

			String operatorDesc = "";
			if ("1".equals(productTuangouOP.getOperatorDesc())) {
				operatorDesc = "成团";
			} else if ("2".equals(productTuangouOP.getOperatorDesc())) {
				operatorDesc = "不成团";
			}
			mapJson.put("operatorDesc", operatorDesc);

			String createDate = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss").format(productTuangouOP.getCreateDate());
			mapJson.put("createDate", createDate);
		}

		return "mapJson";
	}

	public String editTuangouDesc() throws ParseException, CoreException {
		ShelfTuangou shelfTuangou = shelfTuangouService.get(tuangouId);
		mapJson = new TreeMap();
		if (shelfTuangou.getPrizeDesc() == null) {
			mapJson.put("tuangouDesc", "");
		} else {
			mapJson.put("tuangouDesc", shelfTuangou.getPrizeDesc());
		}

		return "mapJson";
	}

	public String saveTuangouDesc() throws ParseException {
		mapJson = new TreeMap();

		try {
			ShelfTuangou shelfTuangou = shelfTuangouService.get(tuangouId);
			shelfTuangou.setPrizeDesc(tuangouDesc);
			shelfTuangouService.update(shelfTuangou);
			mapJson.put("saveMsg", "编辑成功");
		} catch (CoreException ce) {
			mapJson.put("saveMsg", "编辑失败");
		}

		return "mapJson";
	}

	/**
	 * 判断上下架檔期是否重覆
	 * 
	 * @return
	 * @throws ParseException
	 * @throws CoreException
	 */
	public String getJsonCheckIfRecordExist() throws ParseException, CoreException {
		Shelf shelf = new Shelf();
		shelf.setProductId(productId);
		shelf.setStartDate(DateUtils.parseDate(startDateParam + " " + timestart.trim(),
				new String[] { EcConstant.PATTERN_TIMESTAMP_HH_MM }));
		shelf.setEndDate(DateUtils.parseDate(endDateParam + " " + timeend.trim(),
				new String[] { EcConstant.PATTERN_TIMESTAMP_HH_MM }));
		// if (shelfService.checkIfRecordExist(shelf)) {
		// jsonShelfDateExist = "Y";
		// } else {
		// jsonShelfDateExist = "N";
		// }
		jsonShelfDateExist = "N";
		return "jsonCheckIfRecordExist";

	}

	public String getJsonShelfDateExist() {
		return jsonShelfDateExist;
	}

	public String getMinDate() {
		return minDate;
	}

	/**
	 * @return the pager
	 */
	public SimplePager getPager() {
		return pager;
	}

	public Product getProduct() {
		return product;
	}

	/**
	 * @return the productId
	 */
	public String getProductId() {
		return productId;
	}

	/**
	 * @return the productName
	 */
	public String getProductName() {
		return productName;
	}

	/**
	 * @return the promoteNameParam
	 */
	public String getPromoteNameParam() {
		return promoteNameParam;
	}

	/**
	 * @return the shelf
	 */
	public Shelf getShelf() {
		return shelf;
	}

	/**
	 * @return the shelfDelete
	 */
	public String[] getShelfDelete() {
		return shelfDelete;
	}

	/**
	 * @return the shelfId
	 */
	public Long getShelfId() {
		return shelfId;
	}

	/**
	 * @return the shelfMemoParam
	 */
	public String getShelfMemoParam() {
		return shelfMemoParam;
	}

	/**
	 * @return the shelfPriceParam
	 */
	public String getShelfPriceParam() {
		return shelfPriceParam;
	}

	/**
	 * @return the shelfs
	 */
	public List<Shelf> getShelfs() {
		return shelfs;
	}

	/**
	 * @return the shelfService
	 */
	public ShelfService getShelfService() {
		return shelfService;
	}

	/**
	 * @return the shelfStatusParam
	 */
	public String getShelfStatusParam() {
		return shelfStatusParam;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.Preparable#prepare()
	 */

	/**
	 * @return the startDateParam
	 */
	public String getStartDateParam() {
		return startDateParam;
	}

	/**
	 * @return the timeend
	 */
	public String getTimeend() {
		return timeend;
	}

	/**
	 * @return the timestart
	 */
	public String getTimestart() {
		return timestart;
	}

	/* 上下架商品列表 */
	public String list() throws Exception {
		approve = null;
		approveTuangou = null;
		nowStep = "4";
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return "prdTIndex";
		} else {
			product = productService.get(productId);
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return "prdTIndex";
			} else {
				User user = AdminHelper.getUser();
				loginUser = user.getUsername();
				productName = product.getProductName();
				String[] sortOrder = { "shelfId" };
				crit = new CommonCriteria();
				List<String> statusList = null;
				crit.addEq("productId", productId);
				if (StringUtils.isNotBlank(shelfStatusParam)) {
					if (StringUtils.endsWithIgnoreCase("Y", shelfStatusParam)) {
						statusList = new ArrayList<String>();
						statusList.add("SHF000");
						statusList.add("SHF500");
						crit.addIn("shelfStatus", statusList);
					} else if (StringUtils.endsWithIgnoreCase("N", shelfStatusParam)) {
						statusList = new ArrayList<String>();
						statusList.add("SHF600");
						statusList.add("SHF700");
						crit.addIn("shelfStatus", statusList);
					}
				} else {
					statusList = new ArrayList<String>();
					statusList.add("SHF000");
					statusList.add("SHF500");
					crit.addIn("shelfStatus", statusList);
				}
				int entitySize = shelfService.getListSize(crit).intValue();
				pager.setTotalSize(entitySize);
				pager.setPageRecord(10);// defaut 20
				shelfs = shelfService.getList(pager.getCurrentPage() * pager.getPageRecord(), pager.getPageRecord(), crit,
						sortOrder);
				shelfNow = shelfService.getActiveShelfByProductId(productId);

				return "list";
			}
		}
	}

	public String listTuangou() throws Exception {
		approve = null;
		approveTuangou = null;
		nowStep = "4";
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return "prdTIndex";
		} else {
			product = productService.get(productId);
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return "prdTIndex";
			} else {
				User user = AdminHelper.getUser();
				loginUser = user.getUsername();
				productName = product.getProductName();

				// 團購
				// 檢核是否有團購商品管理權限 & 商品類型 & 是否已刪除
				int checkPrdType = product.getProductType();
				String checkIsDel = product.getIsDelete();
				if (AdminHelper.hasPermission(user, "TUANGOU", Type.OTHER)
						&& (checkPrdType == 0 || checkPrdType == 1 || checkPrdType == 7) && "N".equals(checkIsDel)) {
					crit = new CommonCriteria();
					crit.addEq("productId", productId);

					List<String> tuangouStatusList = new ArrayList<String>();
					if (StringUtils.isNotBlank(shelfTuangouQueryStatus)) {
						if (StringUtils.endsWithIgnoreCase("Y", shelfTuangouQueryStatus)) {
							tuangouStatusList.add("SHF000");
							tuangouStatusList.add("SHF500");
							crit.addIn("status", tuangouStatusList);
						} else if (StringUtils.endsWithIgnoreCase("N", shelfTuangouQueryStatus)) {
							tuangouStatusList.add("SHF600");
							tuangouStatusList.add("SHF700");
							crit.addIn("status", tuangouStatusList);
						}
					} else {
						tuangouStatusList.add("SHF000");
						tuangouStatusList.add("SHF500");
						crit.addIn("status", tuangouStatusList);
					}

					int tuangouSize = shelfTuangouService.getListSize(crit).intValue();
					pager.setTotalSize(tuangouSize);
					pager.setPageRecord(10);// defaut 20

					String[] tuangouSortOrder = { "tuangouId" };
					tuangouShelfs = shelfTuangouService.getList(pager.getCurrentPage() * pager.getPageRecord(),
							pager.getPageRecord(), crit, tuangouSortOrder);

					tuangouShelfNow = shelfTuangouService.getActiveShelfTuangouByProductId(productId);
				}

				return "listTuangou";
			}
		}
	}

	public void prepare() throws Exception {
		clearErrorsAndMessages();
		if (pager == null) {
			pager = new SimplePager();
		}
		if (tuangouPager == null) {
			tuangouPager = new SimplePager();
		}
		if (StringUtils.isBlank(minDate)) {
			minDate = DateUtil.convertDateToString("yyyy,MM - 1,dd", DateUtil.getTodayAddDays(-60).getTime());
		}
		if (null == shelfStatusMenu) {
			shelfStatusMenu = menuService.get("Shelf.Status");
		}

		// 找出所有ｐｍ的user
		if (null == users) {
			users = userService.getByRole(Role.Default.PM.name(), Role.Type.OTHER);
		}

		// 找出所有團購的user
		if (null == tuangouUsers) {
			tuangouUsers = userService.getByPermission("TUANGOU", Type.OTHER);
		}

		if (null == shelfQueryStatusMenu) {
			shelfQueryStatusMenu = menuService.get("Shelf.QueryStatus");
		}

		if (null == shelfTuangouStatusMenu) {
			shelfTuangouStatusMenu = menuService.get("ShelfTuangou.Status");
		}

		if (null == shelfTuangouQueryStatusMenu) {
			shelfTuangouQueryStatusMenu = menuService.get("ShelfTuangou.QueryStatus");
		}

		if (null == shelfTuangouSortSeqMenu) {
			shelfTuangouSortSeqMenu = menuService.get("ShelfTuangou.SortSeq");
		}

		if (null == shelfTypeMenu) {
			shelfTypeMenu = menuService.get("Shelf.Type");
		}

		logger.info("prepare ok");
	}

	/**
	 * 儲存上下架商品資料 *
	 * 
	 * @return
	 * @throws Exception
	 */
	public String save() throws Exception {
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
		} else {
			approve = null;
			product = productService.get(productId);
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
			} else {
				DateFormat format = new SimpleDateFormat(EcConstant.PATTERN_TIMESTAMP);

				if (null != shelfId) {
					shelf = shelfService.get(shelfId);
					shelf.setIsLimitBuy(limitBuyParam);
					shelf.setIsValidateNum(validateNumParam);
				} else {
					shelf = new Shelf();
					shelf.setProductId(productId);
					shelf.setIsLimitBuy(limitBuyParam);
					shelf.setIsValidateNum(validateNumParam);

					crit = new CommonCriteria();
					crit.addEq("productId", productId);
					crit.addNe("shelfStatus", "SHF700");
					List<Shelf> shelfs = shelfService.getList(0, -1, crit, null);
					if (shelfs.size() > 0) {
						for (Shelf sf : shelfs) {
							Date aDate = format.parse(startDateParam + " " + timestart.trim() + ":00");
							if (aDate.compareTo(sf.getStartDate()) == 0) {
								addActionError("上架档起始日期与已有上架档重复，请重新输入");
								return list();
							}
						}
					}
					shelf.setStartDate(format.parse(startDateParam + " " + timestart.trim() + ":00"));
				}

				shelf.setPromoteName(promoteNameParam);
				shelf.setShelfPrice(new BigDecimal(shelfPriceParam).setScale(1, BigDecimal.ROUND_FLOOR));

				Calendar cal = Calendar.getInstance();
				cal.setTime(format.parse(endDateParam + " " + timeend.trim() + ":59"));
				// cal.add(Calendar.SECOND, -1);
				shelf.setEndDate(cal.getTime());
				shelf.setShelfMemo(shelfMemoParam);
				grossProfit = categoryService.getGrossProfitByPath(product.getMainCategoryPath());
				// 小于毛利率时需审核
				if (null == grossProfit
						|| (shelf.getShelfPrice().subtract(product.getProductCost()).multiply(new BigDecimal("100")).divide(
								shelf.getShelfPrice(), 1)).floatValue() < grossProfit.floatValue()) {
					shelf.setShelfStatus("SHF000");
				} else {
					shelf.setShelfStatus("SHF500");
				}
				// if (shelfService.checkIfRecordExist(shelf)) { // 判斷是否重覆上架日期
				// addActionMessage("重覆上下架时间");
				// return edit();
				// }
				if (StringUtils.isNotBlank(shelfType)) {
					shelf.setShelfType(shelfType);
				} else {
					shelf.setShelfType("1");// defult 一般
				}
				if (StringUtils.isBlank(validateNumParam)) {
					shelf.setIsValidateNum("N");
				} else {
					shelf.setIsValidateNum(validateNumParam);
				}
				if (StringUtils.isBlank(limitBuyParam)) {
					shelf.setIsLimitBuy("N");
				} else {
					shelf.setIsLimitBuy(limitBuyParam);
				}
				shelf.setGiveBonus(0);// 赠送赠物金点数default 0
				shelf.setApproveDate(null);
				shelf.setApproveFailReason(null);
				shelf.setApproveUser(null);
				shelf = shelfService.saveOrUpdateShelf(shelf);

				// 更新限購商品
				timeLimitSaleService.addTimeLimitProd(product, shelf);
				addActionMessage("储存成功");
			}
		}

		// update 限购管理

		return list();
	}

	public String saveTuangou() throws Exception {
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return listTuangou();
		}

		approveTuangou = null;
		product = productService.get(productId);
		if (null == product) {
			addActionError("查无商品资料(或无该权限查看)");
			return listTuangou();
		}

		DateFormat format = new SimpleDateFormat(EcConstant.PATTERN_TIMESTAMP);
		if (tuangouId != null) {
			shelfTuangou = shelfTuangouService.get(tuangouId);
		} else {
			if (!shelfTuangouService.checkShelfTuangouDate(productId, tuangouStartDate, tuangouStartTime, tuangouEndDate,
					tuangouEndTime)) {
				addActionError("团购活动日期区间不允许重叠");
				return listTuangou();
			}

			shelfTuangou = new ShelfTuangou();
			shelfTuangou.setProductId(productId);
			shelfTuangou.setStartDate(format.parse(tuangouStartDate + " " + tuangouStartTime.trim() + ":00"));
		}

		shelfTuangou.setPromoteName(tuangouPromoteName);
		shelfTuangou.setPrice(new BigDecimal(shelfTuangouPrice).setScale(1, BigDecimal.ROUND_FLOOR));
		shelfTuangou.setEndDate(format.parse(tuangouEndDate + " " + tuangouEndTime.trim() + ":59"));
		shelfTuangou.setSortSeq(shelfTuangouSortSeq);
		shelfTuangou.setLowestOrderQty(Integer.parseInt(tuangouLowestOrderQty));
		shelfTuangou.setMemo(shelfTuangouMemo);

		// 小于毛利率时需审核
		if (new BigDecimal(shelfTuangouPrice).intValue() <= 0) {
			shelfTuangou.setStatus("SHF000");
		} else {
			if (null == grossProfit
					|| (shelfTuangou.getPrice().subtract(product.getProductCost()).multiply(new BigDecimal("100")).divide(
							shelfTuangou.getPrice(), 1)).floatValue() < grossProfit.floatValue()) {
				shelfTuangou.setStatus("SHF000");
			} else {
				shelfTuangou.setStatus("SHF500");
			}
		}

		if (new BigDecimal(shelfTuangouPrice).intValue() <= 0) {
			shelfTuangou.setSalesType("2");
		} else {
			shelfTuangou.setSalesType("1");
		}

		if (StringUtils.isBlank(memberLimit)) {
			shelfTuangou.setMemberLimit("N");
		} else {
			shelfTuangou.setMemberLimit(memberLimit);
		}

		shelfTuangou = shelfTuangouService.saveOrUpdateShelfTuangou(shelfTuangou);

		// 更新限購商品
		timeLimitSaleService.addTuangouTimeLimitProd(product, shelfTuangou);
		addActionMessage("储存成功");

		return listTuangou();
	}

	public String saveApprove() throws Exception {
		if (null == shelfId) {
			addActionError("错误的上架檔编号:id=" + shelfId);
			return edit();
		}
		loginUser = AdminHelper.getUser().getUsername();
		shelf = shelfService.get(shelfId);
		shelf.setShelfStatus(shelfStatus);
		shelf.setApproveUser(loginUser);
		shelf.setApproveDate(new Date());
		if (StringUtils.equals("SHF600", shelfStatus)) {
			if (StringUtils.isNotBlank(approveFailReason)) {
				shelf.setApproveFailReason(approveFailReason);
			} else {
				addActionError("请输入审核失败理由");
				return edit();
			}
		}
		shelf = shelfService.saveOrUpdateShelf(shelf);
		shelfId = shelf.getShelfId();
		approve = null;
		return view();
	}

	public String saveApproveTuangou() throws Exception {
		if (null == tuangouId) {
			addActionError("错误的上架檔编号:id=" + tuangouId);
			return editTuangou();
		}
		loginUser = AdminHelper.getUser().getUsername();
		shelfTuangou = shelfTuangouService.get(tuangouId);
		shelfTuangou.setStatus(shelfTuangouStatus);
		shelfTuangou.setApproveUser(loginUser);
		shelfTuangou.setApproveDate(new Date());
		if (StringUtils.equals("SHF600", shelfTuangouStatus)) {
			if (StringUtils.isNotBlank(approveTuangouFailReason)) {
				shelfTuangou.setApproveFailReason(approveTuangouFailReason);
			} else {
				addActionError("请输入审核失败理由");
				return editTuangou();
			}
		}
		shelfTuangou = shelfTuangouService.saveOrUpdateShelfTuangou(shelfTuangou);
		tuangouId = shelfTuangou.getTuangouId();
		approveTuangou = null;
		return tuangouView();
	}

	public String searchApprove() throws Exception {
		loginUser = AdminHelper.getUser().getUsername();
		Map<String, Object> attrs = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(productIdParam)) {
			attrs.put("productId", productIdParam);
		}
		if (StringUtils.isNotBlank(createUserParam)) {
			attrs.put("createUser", createUserParam);
		}
		if (StringUtils.isNotBlank(createDateParam)) {
			attrs.put("createDate", DateUtil.convertStringToDate(createDateParam + " 23:59:59"));
		}
		if (StringUtils.isNotBlank(statusParam)) {
			attrs.put("shelfStatus", statusParam);
		} else {
			statusParam = "SHF000";
			attrs.put("shelfStatus", "SHF000");
		}
		int entitySize = 0;
		entitySize = shelfService.getShelfApproveListSize(attrs).intValue();
		pager.setTotalSize(entitySize);
		shelfs = shelfService.getShelfApproveList(attrs, null, pager.getCurrentPage() * pager.getPageRecord(),
				pager.getPageRecord());
		productMap = new HashMap<String, Product>();
		for (Shelf shelf : shelfs) {
			productMap.put(shelf.getProductId(), productService.get(shelf.getProductId()));
		}
		return "listApprove";
	}

	public String searchTuangouApprove() throws Exception {
		loginUser = AdminHelper.getUser().getUsername();
		Map<String, Object> attrs = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(productIdParam)) {
			attrs.put("productId", productIdParam);
		}
		if (StringUtils.isNotBlank(createUserParam)) {
			attrs.put("createUser", createUserParam);
		}
		if (StringUtils.isNotBlank(createDateParam)) {
			attrs.put("createDate", DateUtil.convertStringToDate(createDateParam + " 23:59:59"));
		}
		if (StringUtils.isNotBlank(statusParam)) {
			attrs.put("status", statusParam);
		} else {
			statusParam = "SHF000";
			attrs.put("status", "SHF000");
		}
		if (StringUtils.isNotBlank(productNameParam)) {
			attrs.put("productName", "%" + productNameParam + "%");
		}
		int entitySize = 0;
		entitySize = shelfTuangouService.getShelfTuangouApproveListSize(attrs).intValue();
		pager.setTotalSize(entitySize);
		tuangouShelfs = shelfTuangouService.getShelfTuangouApproveList(attrs, null,
				pager.getCurrentPage() * pager.getPageRecord(), pager.getPageRecord());
		productMap = new HashMap();
		Date now = new Date();
		for (ShelfTuangou shelfTuangou : tuangouShelfs) {
			productMap.put(shelfTuangou.getProductId(), productService.get(shelfTuangou.getProductId()));
			if (shelfTuangou.getEndDate().before(now)) {
				productMap.put("isTimeout" + shelfTuangou.getTuangouId(), "true");
			} else {
				productMap.put("isTimeout" + shelfTuangou.getTuangouId(), "false");
			}
		}

		return "listTuangouApprove";
	}

	/**
	 * @param endDateParam the endDateParam to set
	 */
	public void setEndDateParam(String endDateParam) {
		this.endDateParam = endDateParam;
	}

	public void setJsonShelfDateExist(String jsonShelfDateExist) {
		this.jsonShelfDateExist = jsonShelfDateExist;
	}

	public void setMinDate(String minDate) {
		this.minDate = minDate;
	}

	/**
	 * @param pager the pager to set
	 */
	public void setPager(SimplePager pager) {
		this.pager = pager;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	/**
	 * @param productId the productId to set
	 */
	public void setProductId(String productId) {
		this.productId = productId;
	}

	/**
	 * @param productName the productName to set
	 */
	public void setProductName(String productName) {
		this.productName = productName;
	}

	/**
	 * @param productService the productService to set
	 */
	public void setProductService(ProductService productService) {
		this.productService = productService;
	}

	/**
	 * @param promoteNameParam the promoteNameParam to set
	 */
	public void setPromoteNameParam(String promoteNameParam) {
		this.promoteNameParam = promoteNameParam;
	}

	public void setQuotationService(QuotationService quotationService) {
		this.quotationService = quotationService;
	}

	public void setQuotationServiceOnline(QuotationServiceOnline quotationServiceOnline) {
		this.quotationServiceOnline = quotationServiceOnline;
	}

	/**
	 * @param shelf the shelf to set
	 */
	public void setShelf(Shelf shelf) {
		this.shelf = shelf;
	}

	/**
	 * @param shelfDelete the shelfDelete to set
	 */
	public void setShelfDelete(String[] shelfDelete) {
		this.shelfDelete = shelfDelete;
	}

	/**
	 * @param shelfId the shelfId to set
	 */
	public void setShelfId(Long shelfId) {
		this.shelfId = shelfId;
	}

	/**
	 * @param shelfMemoParam the shelfMemoParam to set
	 */
	public void setShelfMemoParam(String shelfMemoParam) {
		this.shelfMemoParam = shelfMemoParam;
	}

	/**
	 * @param shelfPriceParam the shelfPriceParam to set
	 */
	public void setShelfPriceParam(String shelfPriceParam) {
		this.shelfPriceParam = shelfPriceParam;
	}

	/**
	 * @param shelfs the shelfs to set
	 */
	public void setShelfs(List<Shelf> shelfs) {
		this.shelfs = shelfs;
	}

	/**
	 * @param shelfService the shelfService to set
	 */
	public void setShelfService(ShelfService shelfService) {
		this.shelfService = shelfService;
	}

	/**
	 * @param shelfStatusParam the shelfStatusParam to set
	 */
	public void setShelfStatusParam(String shelfStatusParam) {
		this.shelfStatusParam = shelfStatusParam;
	}

	/**
	 * @param startDateParam the startDateParam to set
	 */
	public void setStartDateParam(String startDateParam) {
		this.startDateParam = startDateParam;
	}

	/**
	 * @param timeend the timeend to set
	 */
	public void setTimeend(String timeend) {
		this.timeend = timeend;
	}

	/**
	 * @param timestart the timestart to set
	 */
	public void setTimestart(String timestart) {
		this.timestart = timestart;
	}

	public DomainService<Menu> getMenuService() {
		return menuService;
	}

	public void setMenuService(DomainService<Menu> menuService) {
		this.menuService = menuService;
	}

	public Menu getShelfStatusMenu() {
		return shelfStatusMenu;
	}

	public void setShelfStatusMenu(Menu shelfStatusMenu) {
		this.shelfStatusMenu = shelfStatusMenu;
	}

	public String getShelfStatus() {
		return shelfStatus;
	}

	public void setShelfStatus(String shelfStatus) {
		this.shelfStatus = shelfStatus;
	}

	public String getApproveFailReason() {
		return approveFailReason;
	}

	public void setApproveFailReason(String approveFailReason) {
		this.approveFailReason = approveFailReason;
	}

	public String getApprove() {
		return approve;
	}

	public void setApprove(String approve) {
		this.approve = approve;
	}

	public String getLoginUser() {
		return loginUser;
	}

	public void setLoginUser(String loginUser) {
		this.loginUser = loginUser;
	}

	public List<Map<String, Object>> getShelfHistoryList() {
		return shelfHistoryList;
	}

	public void setShelfHistoryList(List<Map<String, Object>> shelfHistoryList) {
		this.shelfHistoryList = shelfHistoryList;
	}

	public Map<String, Product> getProductMap() {
		return productMap;
	}

	public void setProductMap(Map<String, Product> productMap) {
		this.productMap = productMap;
	}

	public String getProductIdParam() {
		return productIdParam;
	}

	public void setProductIdParam(String productIdParam) {
		this.productIdParam = productIdParam;
	}

	public String getCreateUserParam() {
		return createUserParam;
	}

	public void setCreateUserParam(String createUserParam) {
		this.createUserParam = createUserParam;
	}

	public String getStatusParam() {
		return statusParam;
	}

	public void setStatusParam(String statusParam) {
		this.statusParam = statusParam;
	}

	public String getCreateDateParam() {
		return createDateParam;
	}

	public void setCreateDateParam(String createDateParam) {
		this.createDateParam = createDateParam;
	}

	public String getProductNameParam() {
		return productNameParam;
	}

	public void setProductNameParam(String productNameParam) {
		this.productNameParam = productNameParam;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public Menu getShelfQueryStatusMenu() {
		return shelfQueryStatusMenu;
	}

	public void setShelfQueryStatusMenu(Menu shelfQueryStatusMenu) {
		this.shelfQueryStatusMenu = shelfQueryStatusMenu;
	}

	public Menu getShelfTypeMenu() {
		return shelfTypeMenu;
	}

	public void setShelfTypeMenu(Menu shelfTypeMenu) {
		this.shelfTypeMenu = shelfTypeMenu;
	}

	public String getShelfType() {
		return shelfType;
	}

	public void setShelfType(String shelfType) {
		this.shelfType = shelfType;
	}

	public Shelf getShelfNow() {
		return shelfNow;
	}

	public void setShelfNow(Shelf shelfNow) {
		this.shelfNow = shelfNow;
	}

	public String getValidateNumParam() {
		return validateNumParam;
	}

	public void setValidateNumParam(String validateNumParam) {
		this.validateNumParam = validateNumParam;
	}

	public String getLimitBuyParam() {
		return limitBuyParam;
	}

	public void setLimitBuyParam(String limitBuyParam) {
		this.limitBuyParam = limitBuyParam;
	}

	public String getNowStep() {
		return nowStep;
	}

	public void setNowStep(String nowStep) {
		this.nowStep = nowStep;
	}

	public BigDecimal getGrossProfit() {
		return grossProfit;
	}

	public void setGrossProfit(BigDecimal grossProfit) {
		this.grossProfit = grossProfit;
	}

	public List<Map<String, String>> getJsonDatas() {
		return jsonDatas;
	}

	public void setJsonDatas(List<Map<String, String>> jsonDatas) {
		this.jsonDatas = jsonDatas;
	}

	// 團購getter & setter
	public ShelfTuangouService getShelfTuangouService() {
		return shelfTuangouService;
	}

	public void setShelfTuangouService(ShelfTuangouService shelfTuangouService) {
		this.shelfTuangouService = shelfTuangouService;
	}

	public Menu getShelfTuangouStatusMenu() {
		return shelfTuangouStatusMenu;
	}

	public void setShelfTuangouStatusMenu(Menu shelfTuangouStatusMenu) {
		this.shelfTuangouStatusMenu = shelfTuangouStatusMenu;
	}

	public Menu getShelfTuangouQueryStatusMenu() {
		return shelfTuangouQueryStatusMenu;
	}

	public void setShelfTuangouQueryStatusMenu(Menu shelfTuangouQueryStatusMenu) {
		this.shelfTuangouQueryStatusMenu = shelfTuangouQueryStatusMenu;
	}

	public Menu getShelfTuangouSortSeqMenu() {
		return shelfTuangouSortSeqMenu;
	}

	public void setShelfTuangouSortSeqMenu(Menu shelfTuangouSortSeqMenu) {
		this.shelfTuangouSortSeqMenu = shelfTuangouSortSeqMenu;
	}

	public List<User> getTuangouUsers() {
		return tuangouUsers;
	}

	public void setTuangouUsers(List<User> tuangouUsers) {
		this.tuangouUsers = tuangouUsers;
	}

	public String getShelfTuangouQueryStatus() {
		return shelfTuangouQueryStatus;
	}

	public void setShelfTuangouQueryStatus(String shelfTuangouQueryStatus) {
		this.shelfTuangouQueryStatus = shelfTuangouQueryStatus;
	}

	public SimplePager getTuangouPager() {
		return tuangouPager;
	}

	public void setTuangouPager(SimplePager tuangouPager) {
		this.tuangouPager = tuangouPager;
	}

	public List<ShelfTuangou> getTuangouShelfs() {
		return tuangouShelfs;
	}

	public void setTuangouShelfs(List<ShelfTuangou> tuangouShelfs) {
		this.tuangouShelfs = tuangouShelfs;
	}

	public ShelfTuangou getTuangouShelfNow() {
		return tuangouShelfNow;
	}

	public void setTuangouShelfNow(ShelfTuangou tuangouShelfNow) {
		this.tuangouShelfNow = tuangouShelfNow;
	}

	public String getShelfTuangouStatus() {
		return shelfTuangouStatus;
	}

	public void setShelfTuangouStatus(String shelfTuangouStatus) {
		this.shelfTuangouStatus = shelfTuangouStatus;
	}

	public String[] getShelfTuangouDelete() {
		return shelfTuangouDelete;
	}

	public void setShelfTuangouDelete(String[] shelfTuangouDelete) {
		this.shelfTuangouDelete = shelfTuangouDelete;
	}

	public ShelfTuangou getShelfTuangou() {
		return shelfTuangou;
	}

	public void setShelfTuangou(ShelfTuangou shelfTuangou) {
		this.shelfTuangou = shelfTuangou;
	}

	public Long getTuangouId() {
		return tuangouId;
	}

	public void setTuangouId(Long tuangouId) {
		this.tuangouId = tuangouId;
	}

	public String getApproveTuangou() {
		return approveTuangou;
	}

	public void setApproveTuangou(String approveTuangou) {
		this.approveTuangou = approveTuangou;
	}

	public List<Map<String, Object>> getShelfTuangouHistoryList() {
		return shelfTuangouHistoryList;
	}

	public void setShelfTuangouHistoryList(List<Map<String, Object>> shelfTuangouHistoryList) {
		this.shelfTuangouHistoryList = shelfTuangouHistoryList;
	}

	public String getMemberLimit() {
		return memberLimit;
	}

	public void setMemberLimit(String memberLimit) {
		this.memberLimit = memberLimit;
	}

	public String getShelfTuangouPrice() {
		return shelfTuangouPrice;
	}

	public void setShelfTuangouPrice(String shelfTuangouPrice) {
		this.shelfTuangouPrice = shelfTuangouPrice;
	}

	public String getApproveTuangouFailReason() {
		return approveTuangouFailReason;
	}

	public void setApproveTuangouFailReason(String approveTuangouFailReason) {
		this.approveTuangouFailReason = approveTuangouFailReason;
	}

	public String getTuangouPromoteName() {
		return tuangouPromoteName;
	}

	public void setTuangouPromoteName(String tuangouPromoteName) {
		this.tuangouPromoteName = tuangouPromoteName;
	}

	public String getTuangouStartDate() {
		return tuangouStartDate;
	}

	public void setTuangouStartDate(String tuangouStartDate) {
		this.tuangouStartDate = tuangouStartDate;
	}

	public String getTuangouEndDate() {
		return tuangouEndDate;
	}

	public void setTuangouEndDate(String tuangouEndDate) {
		this.tuangouEndDate = tuangouEndDate;
	}

	public String getTuangouStartTime() {
		return tuangouStartTime;
	}

	public void setTuangouStartTime(String tuangouStartTime) {
		this.tuangouStartTime = tuangouStartTime;
	}

	public String getTuangouEndTime() {
		return tuangouEndTime;
	}

	public void setTuangouEndTime(String tuangouEndTime) {
		this.tuangouEndTime = tuangouEndTime;
	}

	public String getShelfTuangouSortSeq() {
		return shelfTuangouSortSeq;
	}

	public void setShelfTuangouSortSeq(String shelfTuangouSortSeq) {
		this.shelfTuangouSortSeq = shelfTuangouSortSeq;
	}

	public String getTuangouLowestOrderQty() {
		return tuangouLowestOrderQty;
	}

	public void setTuangouLowestOrderQty(String tuangouLowestOrderQty) {
		this.tuangouLowestOrderQty = tuangouLowestOrderQty;
	}

	public String getShelfTuangouMemo() {
		return shelfTuangouMemo;
	}

	public void setShelfTuangouMemo(String shelfTuangouMemo) {
		this.shelfTuangouMemo = shelfTuangouMemo;
	}

	public Map getMapJson() {
		return mapJson;
	}

	public void setMapJson(Map mapJson) {
		this.mapJson = mapJson;
	}

	public String getTuangouDesc() {
		return tuangouDesc;
	}

	public void setTuangouDesc(String tuangouDesc) {
		this.tuangouDesc = tuangouDesc;
	}
}